﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Adm/MasterPage.master" AutoEventWireup="true"
		CodeFile="Editor.aspx.cs" Inherits="Adm_Editor" EnableEventValidation="false" ValidateRequest="false" %>

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
		<ajax:TabContainer ID="myTAB" runat="server" ScrollBars="Auto" ActiveTabIndex="0">
				<ajax:TabPanel ID="tab1" runat="server">
						<HeaderTemplate>
								Editor pagine</HeaderTemplate>
						<ContentTemplate>
								<table style="height: 90%; width: 110%; padding: 5px;">
										<tr>
												<td colspan="2">
														<asp:Button ID="myButtonNuova" runat="server" Text="Nuova pagina" OnClick="myButtonNuova_Click" />
														&nbsp; <b>
																<asp:Label ID="LabelPagina" runat="server"></asp:Label>
														</b>
														<asp:Literal ID="LiteralMsg" runat="server"></asp:Literal>
												</td>
										</tr>
										<tr>
												<td style="vertical-align: top; width: 80%;">
														<asp:HiddenField ID="HiddenFieldPagina" runat="server" />
														<FTB:FreeTextBox runat="server" ID="txtFreeTB" EnableHtmlMode="False" ButtonSet="Office2003"
																UpdateToolbar="True" Height="400px" BreakMode="LineBreak" AllowHtmlMode="True"
																ImageGalleryUrl="~/Contents/Img" OnSaveClick="txtFreeTB_SaveClick" 
																AssemblyResourceHandlerPath="" AutoConfigure="" 
																AutoGenerateToolbarsFromString="True" AutoHideToolbar="True" 
																AutoParseStyles="True" BackColor="158, 190, 245" BaseUrl="" 
																ButtonDownImage="False" ButtonFileExtention="gif" ButtonFolder="Images" 
																ButtonHeight="20" ButtonImagesLocation="InternalResource" 
																ButtonOverImage="False" ButtonPath="" ButtonWidth="21" ClientSideTextChanged="" 
																ConvertHtmlSymbolsToHtmlCodes="False" DesignModeBodyTagCssClass="" 
																DesignModeCss="" DisableIEBackButton="False" DownLevelCols="50" 
																DownLevelMessage="" DownLevelMode="TextArea" DownLevelRows="10" 
																EditorBorderColorDark="Gray" EditorBorderColorLight="Gray" 
																EnableSsl="False" EnableToolbars="True" Focus="False" 
																FormatHtmlTagsToXhtml="True" GutterBackColor="129, 169, 226" 
																GutterBorderColorDark="Gray" GutterBorderColorLight="White" 
																HelperFilesParameters="" HelperFilesPath="" HtmlModeCss="" 
																HtmlModeDefaultsToMonoSpaceFont="True" ImageGalleryPath="~/images/" 
																InstallationErrorMessage="InlineMessage" JavaScriptLocation="InternalResource" 
																Language="us-US" PasteMode="Default" ReadOnly="False" 
																RemoveScriptNameFromBookmarks="True" RemoveServerNameFromUrls="True" 
																RenderMode="NotSet" ScriptMode="External" SslUrl="/." StartMode="DesignMode" 
																StripAllScripting="False" SupportFolder="/aspnet_client/FreeTextBox/" 
																TabIndex="-1" TabMode="InsertSpaces" Text="" TextDirection="LeftToRight" 
																ToolbarBackColor="Transparent" ToolbarBackgroundImage="True" 
																ToolbarImagesLocation="InternalResource" 
																ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule|Cut,Copy,Paste;Undo,Redo,Print" 
																ToolbarStyleConfiguration="Office2003" UseToolbarBackGroundImage="True" 
																Width="700px"></FTB:FreeTextBox>
														<table border="0" style="padding: 2px 5px 5px 2px;" cellspacing="5px">
																<tr>
																		<td>
																				nome pagina<br />
																				<asp:TextBox ID="myTxtNomePagina" Width="250px" Columns="40" runat="server"></asp:TextBox>
																		</td>
																		<td valign="middle">
																				<asp:Button ID="ButtonSalva" runat="server" Text="Salva" 
																						ToolTip="Salva l'utente" Width="118px" OnClick="txtFreeTB_SaveClick" />
																		</td>
																		<td valign="middle">
																				<asp:Button ID="myButtonVediPagina" runat="server" Text="Vedi pagina" 
																						ToolTip="mostra la pagina" Width="118px" 
																						onclientclick="javascript:vediInBrowser();" />
																		</td>
																</tr>
														</table>
												</td>
												<td style="vertical-align: top; top: 10px; width: 30%" align="left">
														<div style="overflow: scroll; height: 96%; width: 98%;">
																<asp:GridView ID="GridViewPagine" runat="server" 
																		OnSelectedIndexChanged="GridViewPagine_SelectedIndexChanged" CellPadding="4" 
																		ForeColor="#333333" GridLines="None"
																		Font-Size="Smaller" Width="300px" onrowcommand="GridViewPagine_RowCommand" 
																		onrowdeleting="GridViewPagine_RowDeleting" >
																		<Columns>
																				<asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/Img/select.jpg" />
																					<asp:CommandField ShowDeleteButton="True" ButtonType="Image" SelectImageUrl="~/Img/delete.jpg" />
																		</Columns>
																		<RowStyle BackColor="#EFF3FB" />
																		<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
																		<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
																		<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
																		<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
																		<EditRowStyle BackColor="#2461BF" />
																		<AlternatingRowStyle BackColor="White" />
																</asp:GridView>
														</div>
												</td>
										</tr>
										<tr>
												<td colspan="2">
												</td>
										</tr>
								</table>
						</ContentTemplate>
				</ajax:TabPanel>
				<%-- secondo tab panel--%>
				<ajax:TabPanel ID="tab2" runat="server">
						<HeaderTemplate>Immagini </HeaderTemplate>
						<ContentTemplate>
						
						<table>
						<tr>
						<td>
						
									<table>
						<tr><td>
								<asp:FileUpload ID="FileUpload1" runat="server" Width="250px" />
						</td><td>
								<asp:FileUpload ID="FileUpload2" runat="server" />
						</td>
						<td>
								<asp:FileUpload ID="FileUpload3" runat="server" Width="250px" />
						</td>
						<tr>
						<td>
								<asp:FileUpload ID="FileUpload4" runat="server" />
						</td>
						<td>
								<asp:FileUpload ID="FileUpload5" runat="server" />
						</td><td>
								<asp:FileUpload ID="FileUpload6" runat="server" />
						</td></tr>		
						<tr>
						<td colspan="3">
								<asp:Button ID="myButtonSalvaImgUpload" runat="server" Text="salva immagini" 
										onclick="myButtonSalvaImgUpload_Click" />
						&nbsp;
								<asp:Literal ID="myLiteralMsgUpload" runat="server"></asp:Literal>
						</td>
						</tr>		
						</table>
						
						</td>
						</tr>
						<tr>
						<td>
								<asp:GridView ID="myGridViewImmagini" runat="server">
								</asp:GridView>
						</td>
						</tr>
						</table>

						
						</ContentTemplate>
				</ajax:TabPanel>
				<%-- terzo tab panel--%>
				<ajax:TabPanel ID="TabPanel3" runat="server">
						<HeaderTemplate>Testo salvato </HeaderTemplate>
						<ContentTemplate>
								<asp:TextBox ID="myTextBoxTestoDebug" runat="server" 
								Columns="60" Rows="50" ReadOnly="true" TextMode="MultiLine"></asp:TextBox>
						</ContentTemplate>
						</ajax:TabPanel>
				
		</ajax:TabContainer>
		<br />
		
		<script type="text/javascript" language="javascript">
				var baseUrl = '<%= mHostWeb %>';
				var pagina = '<%= mNomePagina %>';

    function vediInBrowser() {

    		alert(baseUrl + pagina);
											
				 
				 window.open(baseUrl+ pagina,'Visualizzazione '+pagina,
				 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=900,height=800');
				}
		
		</script>
			
		
</asp:Content>
